Aspects of the present invention relate to relational databases and retrieving information from relational databases in response to a query, and more particularly to a method, system and computer program product for retrieving information from a relational database using user defined facets in a faceted query or faceted interface.
Relational databases still account for a vast majority of data storage systems used for enterprise applications. One approach to facilitate a non-technical user to interact with data from a relational database is to provide a faceted interface to the relational database. A Universal-Relation Data Model is an example of a technique for providing a faceted interface for a relational database. Basically, the Universal-Relation Data Model attributes are considered as facets and the values for those attributes are considered as facet values. A facet may be defined as a user selected attribute or column of an object table in a relational database. FIG. 4 includes an example of a relational database 400. In object table 402, “Customer,” examples of facets may be “Customer.CID” and “Customer.CustomerName.” The Universal-Relation Data Model works well when all of the metadata elements from a domain data model map into the metadata part or database schema of the relational database. However, forming and using a faceted interface become more complex when the metadata of the domain model cannot be fully mapped to the metadata of the relational database schema. Instead, some elements of the domain data model map into the data space of the relational database. For example, different elements in tables in the data model may have varying attributes and different values for each attribute. Having one single table for an element with all attributes may not be feasible because some attributes may not apply to all elements. Therefore, information about attributes and their values may need to be stored as data in relational tables in the relational database. An example of such a relational database is illustrated in FIG. 4 which illustrates different attribute tables in the relational database.